package com.ayf.payment.game.api.service.impl;

import com.ayf.payment.game.api.dto.LogOperationDTO;
import com.ayf.payment.game.api.dto.criteria.LogOperationCriteria;
import com.ayf.payment.game.api.entity.LogOperation;
import com.ayf.payment.game.api.mapper.LogOperationMapper;
import com.ayf.payment.game.api.service.LogOperationService;
import com.swwx.charm.commons.lang.utils.LogPortal;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class LogOperationServiceImpl implements LogOperationService{

    @Resource
    private LogOperationMapper logOperationMapper;

    @Override
    public void insert(LogOperation logOperation) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    logOperationMapper.insert(logOperation);
                }catch (Exception e){
                    LogPortal.error("logOperation Save 日志保存错误",e);
                }
            }
        }).start();
    }

    @Override
    public List<LogOperationDTO> selectAll(LogOperationCriteria criteria) {

        return logOperationMapper.selectAllList(criteria);
    }
}
